package com.cf.wmsg.controller.vo;

import com.cf.wmsg.model.WebMessage;

import java.util.LinkedList;
import java.util.List;

/**
 * boot-message-WebMessageVo
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/7/26 下午 03:13
 */
public class WebMessageVo {

    private String title;

    private String type;

    private boolean needWatch = false;

    private List<WebMessage> webMessageList = new LinkedList<>();


    public void addMessage(WebMessage webMessage) {
        webMessageList.add(webMessage);
    }

    public boolean getNeedWatch() {
        for (WebMessage webMessage : webMessageList) {
            if (!webMessage.getWatched())
                return true;
        }
        return false;
    }

    public void setNeedWatch(boolean needWatch) {
        this.needWatch = needWatch;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public List<WebMessage> getWebMessageList() {
        return webMessageList;
    }

    public void setWebMessageList(List<WebMessage> webMessageList) {
        this.webMessageList = webMessageList;
    }
}
